package cn.iocoder.yudao.module.promotion.gift.job;

import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
import cn.iocoder.yudao.module.promotion.gift.service.core.CoreGiftRecordService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;

/**
 * 赠品过期 Job
 *
 * @author 山野羡民
 */
@Component
public class GiftExpireJob implements JobHandler {

    @Resource
    private CoreGiftRecordService coreGiftRecordService;

    @Override
    @TenantJob
    public String execute(String param) {
        int count = coreGiftRecordService.expire();
        return StrUtil.format("过期赠品 {} 个", count);
    }

}
